#version 400
in vec3 Position;
in vec3 Normal;
layout( location = 0 ) out vec4 FragColor;

vec3 ads( )
{
    vec3 LightPosition = vec3(4800,4800,-4800);
    vec3 LightIntensity = vec3(1.0,1.0,1.0);
    vec3 Kd = vec3(1.0,1.0,1.0);
    //material color
    //vec3 Ka = vec3(120.0,255,201.0);
    vec3 Ka = vec3(84.0,103.0,64.0);
    Ka *= 1.0/255.0;
    vec3 Ks = vec3(1,1,1);

    float Shininess = 64.0;
    vec3 n = normalize(Normal);
    vec3 s = normalize(LightPosition - Position);
    vec3 v = normalize(vec3(-Position));
    vec3 r = reflect(-s,n);

    return
        LightIntensity * (Ka + Kd * max(dot(s,n),0.0) +
               Ks * pow(max(dot(r,v),0.5),Shininess));
}

void main()
{
    FragColor = vec4(ads(),1.0);
}



/*
void main()
{
    colour = vec4(84.0/255.0,93.0/255.0,35.0/255.0,1.0);//CalcPointLight(pointLight);//max(CalcPointLight(pointLight),vec4(0.2,0.2,0.2,0.2));
}*/
